/*
 * 
 * 
 *    마이 페이지 건강치 메뉴창  
 * 
 * 
 */

$(document).ready(function() {
	/* 留덉씠 �섏씠吏�*/
	  $("table td").hover(function() {
	       $(this).addClass('odd');
	  }, function() {
		   $(this).removeClass('odd');  
	  });

});


/*
*
*
*  멤버  공통
*
*
* */
var member = {
    memberWeight: '',
    memberHeight: '',
    memberWaisSize: '',
    memberHipCircumFerence: '',
    memberActivityDergee: '',
    regExp : function() {

    }
}
function memberCheckFunction () {
    member.memberWeight = $('#memberWeight').val();
    member.memberHeight = $('#memberWeight').val();
    member.memberWaisSize = $('#memberWeight').val();
    member.memberHipCircumFerence = $('#memberWeight').val();
    member.memberActivityDergee = $('#memberWeight').val();

    lengthCheck(member.memberWeight, 0, 12, member.regExp());

}

function lengthCheck(value, min, max, reg){
    if(value < min && value > max) {
        alert('길이를 확인해주세요');
        document.getElementById('memberWeight').focus();
        return false;
    }
    else {
    	
    	$('#privateInformation-form').submit();
    }
}



/*
 * 
 * 
 *    멤버 관련 function - login/member  
 * 
 * 
 */

	
	function mypage(memberId) {
		$.ajax({
			url: 'member.spring?action=mypage&memberId=' + memberId,
			method:'post',
			success:function(html) {
				$("#contentDiv" ).css({
				});
				$(".parsingPage").html(html);
			},
			error:function(){
				alert("fail");	
			}
	
		});
	}
	
	function memberPreModify(memberId){
		$.ajax({
			url: 'member.spring?action=premodify&memberId=' + memberId,
			method:'post',
			success:function(html) {
				$(".parsingPage").html(html);
			},
			error:function(){
				alert("fail");	
			}
		});
	}
	
	
	function memberModify() {
		$.ajax({
			url: 'member.spring?action=premodify',
			method:'post',
			success:function(html) {
				console.log(html);
				$("#contentDiv" ).css({
					'display': 'inherit'
				});
				$(".parsingPage").html(html);
			},
			error:function(){
				alert("fail");	
			}
	
		});
	}
	
	
	function memberAdd() {
		$.ajax({
			url: 'member.spring?action=preadd',
			method:'post',
			success:function(html) {
				$(".parsingPage").html(html);
			},
			error:function(){
				alert("fail");
			}
		});
	}
	
	function healthCheckUp(memberId){
		 window.open("member.spring?action=healthCheckUp&memberId=" + memberId,
		         "_blank",
		         "width=420," +
		         " height=500," +
		         " toolbar=no, " +
		         "menubar=no, " +
		         "scrollbars=no," +
		         "resizable=no, " +
		         "copyhistory=no"+
		         "location=no");
	}










